//
//  ThumbnailPresentable.swift
//  Noasis
//
//  Created by 刘伟 on 16/2/28.
//  Copyright © 2016年 lawrence_liu. All rights reserved.
//

import UIKit

protocol ThumbnailPresentable {
    var thumbnailUrl: String { get }
    var thumbnailHandler: (Void -> Void)? { get }
    func updateImageView(imageView: UIImageView)
}

extension ThumbnailPresentable {
    var thumbnailHandler: (Void -> Void)? {
        let f =  {
            print("你貌似点击了图片。")
        }
        return f
    }
    
    func updateImageView(imageView: UIImageView){
        imageView.clipsToBounds = true
        imageView.image = UIImage(named: thumbnailUrl)
    }
    
    func thumbnailImageViewTapped(){
        thumbnailHandler?()
    }
}